package com.cjg.netCode;

import java.net.MalformedURLException;
import java.net.URL;

public class udpURL {
    public static void main(String[] args) throws Exception {
        URL url = new URL("https://localhost:7777/url/url.html?username=me&password=123");
        System.out.println(url.getProtocol()); //协议
        System.out.println(url.getHost());//ip
        System.out.println(url.getPort());//端口
        System.out.println(url.getPath());//文件
        System.out.println(url.getFile());//文件全路径
        System.out.println(url.getQuery());//参数


    }
}
